<?php


namespace app\admin\logic;


use app\admin\model\AppUpdateLog;
use think\facade\Cache;

/**
 * app更新处理
 * Class AppUpdateLogic
 * @package app\admin\logic
 * @author Mr.Li
 * @create 2021-08-19 9:55
 */

class AppUpdateLogic implements ObService
{

    /**
     * 设置app更新记录
     * @param $params
     * @author Mr.Li
     * @create 2021-08-19 9:55
     */
    public function notify($params){
        $cacheData = [];
        $appType = [
            'admin_android_app_set' => 'android',
            'admin_ios_app_set' => 'ios',
        ];
        if(isset($params['name'])){
            foreach($params['name'] as $v){
                $cacheData[$v] = $params[$v] ?? '';
            }
        }
        $cacheData['app_type'] = $appType[$params['group']] ?? '';
        $cacheData && $cacheData['create_time'] = time() && AppUpdateLog::create($cacheData,['app_version','app_type','app_log']);
    }

    public static function get($appType){}

}
